var props2 = "status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes";

function newWindow(url,windowName){
    if(windowName==null){
        windowName="";
    }
    var newwin = window.open(url,windowName,props2+","+getSizeAndLocation());
}

function getSizeAndLocation(){
    var sizeAndLocation = "";
    var h = 430;
    var w = 630;
    var lft = 0;
    var tp = 0;
    if(screen.width<=800)
    {
        h=378;
        w=610;
    }else{
        h = 525;
        w = 826;
    }   
    lft = (screen.width - w)/2;
    tp = (screen.height -h)/2;
    sizeAndLocation="width="+w+
            ",height="+h+
            ",left="+lft+
            ",top="+tp;
    return sizeAndLocation;
}